<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>set_message</title>
    <link rel="stylesheet" href="../../css/base.css">
    <link rel="stylesheet" href="../../css/fy/set_message.css">
</head>

<body>
    <div class="wrap">

        <!-- 头 -->
        <div class="parcel">
            <header>
                <div class="concent">
                    <div class="logo">
                        <a class="sub_log" href="/">胶囊日记</a>
                    </div>
                    <ul class="nav">
                        <li>
                            <a href="../ys/index.html">首页</a>
                        </li>
                        <li>
                            <a href="../zy/guanzhugeren1.html">关注</a>
                        </li>
                        <li>
                            <a href="/">话题</a>
                        </li>
                        <li>
                            <a href="/"><span>App</span>下载</a>
                        </li>
                    </ul>
                </div>

                <div class="sub_nav">

                    <div class="see write_diary">
                        <a class="writeDiary" href="./text _diary.html">写日记</a>
                        <div class="color"></div>
                    </div>

                    <div class="see alert">
                        <a href="/">提醒(0)<span>▼</span></a>
                        <div class="alert_matter">
                            <div class="matter"></div>
                            <div class="sub_matter">
                                <span>没有提醒</span>
                            </div>
                        </div>

                    </div>


                    <div class="see auto">
                        <div class="userName">
                            <span class="mingzi"></span>
                            ▼
                        </div>

                        <div class="auto_sort">
                            <div class="sort"></div>
                            <div class="sub_sort">
                                <a href="/">我的日记</a>
                                <a href="/">我关注的人</a>
                                <a href="../../html/fy/set_message.html">设置</a>
                                <a href="/">退出</a>
                            </div>
                        </div>
                    </div>

                </div>

            </header>
        </div>
        <div class="top"></div>

        <!-- 主体 -->
        <div class="main">
            <!-- 个人信息 导航 -->
            <ul class="message">
                <li>
                    个人信息
                </li>
                <li>
                    <a href="../../html/fy/set_privacy.html">隐私设置</a>
                </li>
                <li>
                    <a href="../../html/fy/set-account.html">账号设置</a>
                </li>
            </ul>

            <!-- 内容更改 -->
            <div class="sub_message">
                <div class="name">
                    <span class="sub_name">名字:</span>
                    <div class="name_new">
                        <input type="text" id="names">
                    </div>
                </div>

                <div class="recommend">
                    <span class="sub_recommend">介绍:</span>
                    <textarea name="" id="text" cols="30" rows="10"></textarea>
                </div>

                <div class="set_icon">
                    <span class="sub_icon">头像:</span>
                    <div class="sets">

                        <div class="imgs">
                            <!-- <img src="" alt=""> -->
                        </div>

                        <a href="../../html/fy/set_change.html">设置</a>
                    </div>
                    <div class="bth">
                        <!-- <button class="save">保存设置</button> -->
                        <a class="save" href="../lk/user-diary.html">保存设置</a>
                        <a class="write_off" href="../../html/fy/set_change.html">取消</a>
                    </div>
                </div>
            </div>
        </div>


        <!-- 底 -->
        <div class="sole">
            <footer>
                <ul class="about_us">
                    <li>
                        <p>© 2009－2022</p>
                        <a class="timep" href="/">timepill.net</a>
                        <span>|</span>
                    </li>
                    <li>
                        <a href="/">沪ICP备18006482号-1</a>
                        <span>|</span>
                    </li>
                    <li>
                        <a href="/">常见问题</a>
                        <span>|</span>
                    </li>
                    <li>
                        <a href="/">捐助胶囊</a>
                        <span>|</span>
                    </li>
                    <li>
                        <p class="about">联系我们:mx1700@gmail.com</p>
                    </li>
                </ul>


                <ul class="rendered">
                    <li>
                        <a href="/">图片存储由又拍云存储提供</a>
                        <span>|</span>
                    </li>
                    <li>
                        <p>rendered in 0.0034 s</p>
                    </li>
                </ul>
            </footer>

        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
    <!-- <script src="../../js/fy/ajax.js"></script> -->
    <script src="../../js/requestPre.js"></script>
<<<<<<< HEAD
    <script src="../../js/fy/set_message.js"></script>

=======
    <!-- <script src="../../js/fy/ajax.js"></script> -->
    <script>

        localStorage.setItem('token', "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYzMjE5N2JkOGMwZmQzMzNmNjQ2ZDE3YyIsImlhdCI6MTY2MzMxMjEzOSwiZXhwIjoxNjYzNDg0OTM5fQ.TcXnHSGS4MdNLVkmjFhZQyGGcFeaZdppHdTMg_4bkDI")

        let namesEl = document.querySelector('#names')
        let textEl = document.querySelector('#text')
        let imgs = document.querySelector('.imgs')

        let saveEl = document.querySelector('.save')


        // 保存设置按钮点击事件
        saveEl.addEventListener("click", saveSettings)
        async function saveSettings(e) {
            // let names = namesEl.value
            // let text = textEl.value
            // let img = imgs.value


            let res = await axios({
                method: 'POST',
                url: '/api/user/revise',
                data: {
                    "userId": "632197bd8c0fd333f646d17c",
                    "username": "HCS",
                    "description": "a good god"
                }
            })
            console.log(res);


            // 根据返回内容作出对应响应（失败->提示，成功->跳转至登陆）
            let { code, msg } = res.data

            // 报错，弹出错误信息
            if (code) {
                return alert(msg)
            }

            // 成功，跳转至登陆
            location.href = '../lk/my-diary.html'
        }

    </script>
>>>>>>> 096bacc8c8ec486a8690e4749be02e8a4d1777c8
</body>

</html>